import os

__tags__ = "file, meta, info, size, modified"

class FileInfo(ni.Node):
    ''' Get meta information about a given file '''
    
    file = ni.File(default="")
    size = ni.Int(depends=(file,))
    modified = ni.Date(depends=(file,))
    
    def compute_size(self):
        return os.path.getsize(self.file)
    
    def compute_modified(self):
        return os.path.getmtime(self.file)